//package com.spring.showcase.init;
//
//import java.net.MalformedURLException;
//import java.net.URL;
//
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.ComponentScan;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.format.annotation.DateTimeFormat.ISO;
//import org.springframework.format.datetime.DateFormatter;
//import org.springframework.format.datetime.DateFormatterRegistrar;
//import org.springframework.format.number.NumberFormatAnnotationFormatterFactory;
//import org.springframework.format.support.DefaultFormattingConversionService;
//import org.springframework.format.support.FormattingConversionService;
//import org.springframework.remoting.jaxws.JaxWsPortProxyFactoryBean;
//import org.springframework.remoting.jaxws.SimpleJaxWsServiceExporter;
//
//import com.spring.showcase.jaxws.DeferredResultWebService;
//import com.spring.showcase.jaxws.WebServiceInterface;
//
//@Configuration
//@ComponentScan(basePackages = { "com.spring.showcase.**" })
//public class RootConfig {
//
//	@Bean
//	public SimpleJaxWsServiceExporter getJaxWsServiceExporter() {
//		return new SimpleJaxWsServiceExporter();
//	}
//
//	@Bean
//	public DeferredResultWebService getDeferredResultWebService() {
//		return new DeferredResultWebService();
//	}
//
//	@Bean
//	public FormattingConversionService conversionService() {
//		DefaultFormattingConversionService conversionService = new DefaultFormattingConversionService(
//				false);
//		conversionService
//				.addFormatterForFieldAnnotation(new NumberFormatAnnotationFormatterFactory());
//		DateFormatterRegistrar registrar = new DateFormatterRegistrar();
//		DateFormatter dateFormatter = new DateFormatter();
//		dateFormatter.setIso(ISO.DATE);
//		registrar.setFormatter(dateFormatter);
//		registrar.registerFormatters(conversionService);
//		return conversionService;
//	}
//
//	@Bean(name = "ws")
//	JaxWsPortProxyFactoryBean getJaxWsPortProxyFactoryBean()
//			throws MalformedURLException {
//		JaxWsPortProxyFactoryBean jaxWsPortProxyFactoryBean = new JaxWsPortProxyFactoryBean();
//		jaxWsPortProxyFactoryBean
//				.setServiceInterface(WebServiceInterface.class);
//		jaxWsPortProxyFactoryBean.setWsdlDocumentUrl(new URL(
//				"http://localhost:8080/defer?WSDL"));
//		jaxWsPortProxyFactoryBean
//				.setNamespaceUri("http://jaxws.showcase.spring.com/");
//		jaxWsPortProxyFactoryBean.setServiceName("defer");
//		jaxWsPortProxyFactoryBean.setPortName("DeferredResultWebServicePort");
//		jaxWsPortProxyFactoryBean.setLookupServiceOnStartup(false);
//		return jaxWsPortProxyFactoryBean;
//	}
//
//}
